﻿<?php session_start(); ?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>
<title>Parent Informer RCSHS - Login Lobby</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<link rel=stylesheet href="css-layouts/themes/defaulttheme.css" type="text/css">
<link rel=stylesheet href="css-layouts/headlinks.css" type="text/css">
</head>

<?php 

require_once("sqlconfig.php");

mysql_connect($server, $sqlusr, $sqlpass) or die(mysql_error());
mysql_select_db($mydb) or die(mysql_error()); 

//Checks if there is a login cookie
if(isset($_COOKIE["parentinformerprcshs"]) || isset($_COOKIE["parentinformerurcshs"])) {
	if(isset($_COOKIE["parentinformerprcshs"])) {
		$username = $_COOKIE["parentinformerprcshs"]; 
	}
	else {
		$_SESSION['theerrcode'] = 2;
		header("Location: modules/logerr_atmpt.php");
	}

	$pass = $_COOKIE["parentinformerurcshs"];
	$check = mysql_query("SELECT * FROM logtbl WHERE usernm = '".$username."'") or die(mysql_error());
	while($info=mysql_fetch_array($check)) {
		if ($pass!=$info['pwrnd']) {
			$_SESSION['theerrcode'] = 2;
			header("Location: modules/logerr_atmpt.php");
		}
		else {
			header("Location: main.php");
		}
	}
}
else {

?>

<body>
<div id="mainhead"><br><br><br></div>
<center>
<br>
<br>
<div id="logintitle">&nbsp;<br><br><br><br><br><br><br></div>
<br>
</center>

<br>

<form method=post action="modules/verify.php">
<table align=center id="labelforms">

<tr>
<td>Username:</td>
<td><input type="text" name="usrnm"></td>
</tr>

<tr>
<td>Password:</td>
<td><input type="password" name="paswrd"></td>
</tr>

<tr>
<td></td>
<td><input type="submit" name="submitbtn" value="Login"></td>
</tr>

</table>
</form>

<div align=left class="mainpagetext">
<b>ANNOUNCEMENTS:</b>
<br>

<p>
<b>Scheduled Maintenance:</b><br>
Please be advised that Parent Informer will be having a scheduled maintenance
from August 29, 2011 9:00AM to August 30, 2011 6:00PM. The website will be
non-operational from these dates.
</p>

<p>
<b>First Quarter Grades SY 2011-2012 Released:</b><br>
Grades for the ...
</p>

</div>

<div class="footnav" align=center>

<hr>

<b>Main Page</b> ||
<a href="qurra">QuRRA</a> ||
<a href="externalaffairs/newaccnt.php">Request Account</a> ||
<a href="#">Help</a> ||
<a href="#">Disclaimer</a> ||
<a href="externalaffairs/links.php">Links</a> ||
<a href="#">About</a>
<br>

<span id="copyme">
&copy; 2011 Roosevelt College Science High School. All rights reserved.
</span>

<br><br>
<a href="http://validator.w3.org/check?uri=referer"><img src="img/valid-html401.png" alt="Valid HTML 4.01 Transitional" border="0"></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img src="img/valid-css.gif" alt="Valid CSS3!" border="0"></a>
</div>

</body>

<?php

}

?>

</html>